import { createRouter, createWebHistory } from "vue-router";
import route2 from "./route2";
const routes = [
  {
    path: "/Home",
    name: "Home",
    component: () => import("../views/Home.vue"),
  },
  ...route2,
  {
    path: "/Newhome",
    name: "新房",
    component: () => import("../views/Newhome.vue"),
  },
  {
    path: "/Two",
    name: "二手房",
    component: () => import("../views/Two.vue"),
  },
  {
    path: "/Chuzu",
    name: "出租房",
    component: () => import("../views/Chuzu.vue"),
  },
  {
    path: "/Login",
    name: "登录",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/Zhuyu",
    name: "通过登录", ////这是通过登录进入的主页
    icon: "good-job-o",
    component: () => import("../views/Zhuyu.vue"),
    redirect: "/Z-home",
    children: [
      {
        path: "/Z-home",
        name: "主-首页", //主页的第一个首页
        component: () => import("../views/Z-home.vue"),
      },
    ],
  },
  {
    path: "/Fabu",
    name: "发布",
    component: () => import("../views/Fabu.vue"),
  },
  {
    path: "/Zhibotianjia",
    name: "添加直播",
    component: () => import("../views/Zhibotianjia.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
